<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<head>
<meta charset="UTF-8">
</head>
<body>
	<div class="easyui-panel" border=false style="padding: 10px 20px">
		<form id="formId" method="post" action="systemMenu!save.action"
			method="post" enctype="multipart/form-data">
			<div class="pageFormContent" layoutH="58">
				<input type="hidden" name="id" value="${vo.id}" />
				<div class="unit">
					<label style="text-align:right;width: 60px">上级分类：</label> <input name="parentMenu"
						class="easyui-combotree" value="${vo.parentMenu}"
						data-options="url:'systemMenu!load.action',method:'get',required:false"
						style="width: 200px;">
				</div>
				<div class="unit">
					<label style="text-align:right;width: 60px">名称：</label> <input type="text"
						name="name" size="50" minlength="0" maxlength="100"
						class="easyui-textbox" data-options="required:true,width:'200px'"
						value="${vo.name}" />
				</div>
				<div class="unit">
					<label style="text-align:right;width: 60px">图标：</label> <input type="text"
						name="menuIcon" size="50" minlength="0" maxlength="100" id="menuIcon"
						class="easyui-textbox" data-options="required:false,width:'200px'"
						value="${vo.menuIcon}" />
						<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add'" onclick="showWin('winselect','systemMenu!selectMenuIcon.action')">添加</a>
				</div>
				<div class="unit">
					<label style="text-align:right;width: 60px">地址：</label> <input type="text"
						name="pageUrl" size="50" minlength="0" maxlength="50"
						class="easyui-textbox" data-options="required:false,width:'200px'"
						value="${vo.pageUrl}" />
				</div>
				<div class="unit">
					<label style="text-align:right;width: 60px">系统标示：</label> <input type="text"
						name="pageFlag" size="50" minlength="0" maxlength="50"
						class="easyui-textbox" data-options="required:false,width:'200px'"
						value="${vo.pageFlag}" />
				</div>
				<div class="unit">
					<label style="text-align:right;width: 60px">自定义权限：</label> <input type="text"
						name="defineRight" size="50" minlength="0" maxlength="50"
						class="easyui-textbox" data-options="required:false,width:'200px'"
						value="${vo.defineRight}" />
				</div>
				<div class="unit">
					<label style="text-align:right;width: 60px">排序码：</label> <input type="text"
						name="nindex" size="50" minlength="0" maxlength="50"
						class="easyui-textbox" data-options="required:true,width:'200px'"
						value="${vo.nindex}" />
				</div>
				<div class="unit">
					<label style="text-align:right;width: 60px">是否启用：</label>
					<c:forEach items="${yesOrNoMap}" var="entry">
						<c:choose>
							<c:when test="${vo.isActive == entry.key}">
								<label><input type="radio" name="isActive"
									value="${entry.key}" checked="checked" />${entry.value}</label>
							</c:when>
							<c:otherwise>
								<label><input type="radio" name="isActive"
									value="${entry.key}" />${entry.value}</label>
							</c:otherwise>
						</c:choose>
					</c:forEach>
				</div>
			</div>
		</form>
	</div>
	<div style="text-align: center; padding: 10px">
		<a href="javascript:void(0)" class="easyui-linkbutton"
			iconCls="icon-save" onclick="saveForm('formId','dg','win')">提交</a> <a
			href="javascript:void(0)" class="easyui-linkbutton"
			iconCls="icon-cancel" onclick="clearForm('win')">取消</a>
	</div>
	<script>
		function radioCheck() {
			var r1 = document.getElementById("r1");
			var r2 = document.getElementById("r2");

			if (r1.checked == true) {
				document.getElementById("sex").value = "1";
			} else {
				document.getElementById("sex").value = "0";
			}
		}
		function saveForm(fid, gid, wid) {
			$('#' + fid).form('submit', {
				onSubmit : function() {
					return $(this).form('enableValidation').form('validate');
				},
				success : function(data) {
					var data = eval('(' + data + ')');
					if (data) {
						if (data.statusCode == "200") {
							showMsg('提示', data.message);
							location.reload();
						} else {
							showMsg('提示', data.message);
						}
					} else {
						showMsg('提示', '操作失败！');
					}
				}
			});
		}
		function menuIconSelectfun(value) {
			$('#winselect').window('close');
			$('#menuIcon').textbox("setValue", "icon-"+value);
		}
	</script>
</body>
